// 注意语法。。。不是cjs
const regex = {
    qq: /^[1-9]\d{4,12}$/,
    cn: /^[\u4e00-\u9fa5]+$/,
    tel: /^(\d{4}-\d{7,8}|\d{3}-\d{8})$/,
    phone: /^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\d{8}$/,
    idCard: /^\d{6}(18|19|20)?\d{2}(0[1-9]|1[012])(0[1-9]|[12]\d|3[01])\d{3}(\d|[xX])$/,
    email: /^\w+@[a-z0-9A-Z]+\.[a-z]+$/,

    num: /^\d+$/,
    letter: /^[a-zA-Z]+$/,
}

exports.regex = regex

exports.nativeRules = {
    num: {
        trigger: 'blur',
        pattern: regex.num,
        message: '请输入数字',
    },
    cn: {
        trigger: 'blur',
        pattern: regex.cn,
        message: '请输入汉字',
    },
    letter: {
        trigger: 'blur',
        pattern: regex.letter,
        message: '请输入字母',
    },
    phone: {
        trigger: 'blur',
        pattern: regex.phone,
        message: '请输入正确的手机号码',
    },
    email: {
        trigger: 'blur',
        pattern: regex.email,
        message: '请输入正确的邮箱',
    },
    idCard: {
        trigger: 'blur',
        pattern: regex.idCard,
        message: '请输入正确的身份证号码',
    },
    tel: {
        trigger: 'blur',
        pattern: regex.tel,
        message: '请输入正确的电话号码',
    },
    qq: {
        trigger: 'blur',
        pattern: regex.qq,
        message: '请输入正确的QQ号码',
    },
}



